<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Construct a new TokyoTyrant object</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="tokyotyrant.connecturi.html">TokyoTyrant::connectUri</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="tokyotyrant.copy.html">TokyoTyrant::copy</a></div>
 <div class="up"><a href="class.tokyotyrant.html">TokyoTyrant</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="tokyotyrant.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">TokyoTyrant::__construct</h1>
  <p class="verinfo">(PECL tokyo_tyrant &gt;= 0.1.0)</p><p class="refpurpose"><span class="refname">TokyoTyrant::__construct</span> &mdash; <span class="dc-title">Construct a new TokyoTyrant object</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-tokyotyrant.construct-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>TokyoTyrant::__construct</strong></span>
    ([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$host</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$port</code><span class="initializer"> = TokyoTyrant::RDBDEF_PORT</span></span>
   [, <span class="methodparam"><span class="type">array</span> <code class="parameter">$options</code></span>
  ]]] )</div>

  <p class="para rdfs-comment">
   Constructs a new TokyoTyrant object and optionally connects to the database
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-tokyotyrant.construct-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">host</code></em></dt>

     <dd>

      <p class="para">
       The hostname. Default: <strong><code>NULL</code></strong>
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">port</code></em></dt>

     <dd>

      <p class="para">
       port number. Default: 1978
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">options</code></em></dt>

     <dd>

      <p class="para">
       Connection options: timeout (default: 5.0), reconnect (default: <strong><code>TRUE</code></strong>) and persistent (default: <strong><code>TRUE</code></strong>)
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-tokyotyrant.construct-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Throws TokyoTyrantException if connection to database fails
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-tokyotyrant.construct-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="methodname"><a href="tokyotyrant.connect.html" class="methodname" rel="rdfs-seeAlso">TokyoTyrant::connect()</a> - Connect to a database</span></li>
    <li class="member"><span class="methodname"><a href="tokyotyrant.connecturi.html" class="methodname" rel="rdfs-seeAlso">TokyoTyrant::connectUri()</a> - Connects to a database</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="tokyotyrant.connecturi.html">TokyoTyrant::connectUri</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="tokyotyrant.copy.html">TokyoTyrant::copy</a></div>
 <div class="up"><a href="class.tokyotyrant.html">TokyoTyrant</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
